﻿CREATE TABLE [dbo].[impOrders] (
	[SourceOrderID] [varchar](50) NULL,
	[SourceCustomerID] [varchar](50) NULL,
	[FirstName] [nvarchar](50) NULL,
	[MiddleName] [nvarchar](50) NULL,
	[LastName] [nvarchar](50) NULL,
	[Company] [nvarchar](50) NULL,
	[Address1] [nvarchar](100) NULL,
	[Address2] [nvarchar](100) NULL,
	[Address3] [nvarchar](100) NULL,
	[City] [nvarchar](50) NULL,
	[State] [nvarchar](50) NULL,
	[PostalCode] [varchar](10) NULL,
	[Country] [nvarchar](50) NULL,
	[Phone] [varchar](20) NULL,
	[EMail] [varchar](50) NULL,
	[Language] [varchar](50) NULL,
	[OrderDate] [smalldatetime] NULL,
	[OrderSource] [nvarchar](50) NULL,
	[PreferredShipMethod] [char](10) NULL,
	[PaidAmount] [money] null, -- If PaidAmount is null then the order is not prepaid
	[CardNumber] [varchar](16) NULL,
	[CardExpiration] char(7) NULL,
	[CardCVV2] [varchar](4) NULL,
	[CardAuthorization] [varchar](10) NULL,
	[CardAuthorizationDate] [smalldatetime] NULL,
	[CardResponseCode] [varchar](3) NULL,
	[DebitCredit] [char](1) NULL,
	[AvsResponse] [char](2) NULL,
	[Cvv2Response] [char](1) NULL,
	[AuthAmount] money null,
	[BankAccountNumber] [nvarchar](50) NULL,
	[BankRoutingNumber] [nvarchar](50) NULL,
	[ShipToFirstName] [nvarchar](50) NULL,
	[ShipToLastName] [nvarchar](50) NULL,
	[ShipToCompany] [nvarchar](50) NULL,
	[ShipToAddress1] [nvarchar](100) NULL,
	[ShipToAddress2] [nvarchar](100) NULL,
	[ShipToAddress3] [nvarchar](100) NULL,
	[ShipToCity] [nvarchar](50) NULL,
	[ShipToState] [nvarchar](50) NULL,
	[ShipToPostalCode] [varchar](10) NULL,
	[ShipToCountry] [nvarchar](50) NULL,
	[Shipping] [money] NULL, -- If Shipping is null then calculate the shipping amount
	[QtyOrdered] [int] NULL, 
	[ItemCode] [varchar](30) NULL,
	[UnitPrice] [money] NULL,
	[UnitDiscount] [float] null,
	[id] [int] IDENTITY(1,1) NOT NULL,
	[OwnerID] [int] not null
);

